package threadandhandler.demo;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;

public class ThreadDeepActivity extends Activity {

	Handler handler = new Handler();
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		handler.post(thread);
		setContentView(R.layout.threaddeep);
		
		Log.v("Thread Log", "Activity Thread id-->" + Thread.currentThread().getId());
		Log.v("Thread Log", "Activity Thread name -->" + Thread.currentThread().getName());
		
	}
	

	
	Runnable thread = new Runnable() {

		public void run() {
			
			
			try {
				Thread.sleep(10000);
			} catch (Exception e){
				e.printStackTrace();
			}
			Log.v("Thread Log", "Runnable Thread id-->" + Thread.currentThread().getId());
			Log.v("Thread Log", "Runnable Thread name -->" + Thread.currentThread().getName());
		}
		
	};

}
